package com.test.springboottest.service;

import com.test.springboottest.domain.User;
import com.test.springboottest.domain.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liqingbo
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;

    /**
     * 调用mapper验证用户登录
     *
     * @param uname
     * @param upwd
     * @return
     */
    @Override
    public User getLoginUser(String uname, String upwd) {
        return userMapper.getLoginUser(uname, upwd);
    }

    @Override
    public List<User> getUserList() {
        return userMapper.getUserList();
    }

    @Override
    public User getUserByUid(Integer uid) {
        return userMapper.getUserByUid(uid);
    }

    @Override
    public int modifyUser(User user) {
        return userMapper.modifyUser(user);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUserByUid(Integer uid) {
        return userMapper.deleteUserByUid(uid);
    }
}
